package org.p2psimulator.entity.protocol.messages.general;

import org.p2psimulator.entity.Id;
import org.p2psimulator.entity.Message;
import org.p2psimulator.entity.behavior.BehaviorTypes;
import org.p2psimulator.entity.protocol.messages.MessageTypes;

@SuppressWarnings ("unchecked")
public class QueryMessage extends Message {



	public QueryMessage(Id origin, Id destination, int transactionId,
			BehaviorTypes originBehavior) {
		super(origin, destination, transactionId, originBehavior);
	}

	private Id key; // para buscas Chord

	//private Double keyword; // para buscas Gnutella


	public Id getKey() {
		return key;
	}

	public void setKey(Id key) {
		this.key = key;
	}

//	public Double getKeyword() {
//		return keyword;
//	}
//
//	public void setKeyword(Double keyword) {
//		this.keyword = keyword;
//	}

	@Override
	public String getName() {

		// deve ser criado desta maneira porque nomes de mensagens
		// s�o encarados com objetos �nicos na mem�ria
		return MessageTypes.QUERY_MESSAGE.getName();
	}

	@Override
	public MessageTypes getMessageType() {

		return MessageTypes.QUERY_MESSAGE;
	}
}
